import Vue from 'vue'
import App from './App'
import Vuex from 'vuex'

Vue.use(Vuex)


Vue.config.productionTip = false

App.mpType = 'app'

import util from './utils/util.js';
Vue.prototype.$util = util;

/*begin 多语言支持*/
import VueI18n from './static/i18n/vue-i18n.min.js';
Vue.use(VueI18n);

const i18n = new VueI18n({
	locale: 'zh-CN',
	messages: {
		'zh-CN': require("./static/i18n/langs/zh"),
		'en-US': require('./static/i18n/langs/en'),
		'zh-Tw': require('./static/i18n/langs/tw')
	}
});
Vue.prototype._i18n = i18n;
/*end 多语言支持*/

import http from './utils/http.js';
Vue.prototype.$http = http;

import sys from './utils/sys.js';
Vue.prototype.$sys = sys;

const app = new Vue({
	i18n,
    ...App
})


Vue.filter("formatDate",(date)=>{
	const nDate=new Date(date)
	const year=nDate.getFullYear() 
	const month=(nDate.getMonth()+1).toString().padStart(2,0)
	const day=nDate.getDate().toString().padStart(2,0)
	
	const hour = nDate.getHours().toString().padStart(2,0)
	const minute = nDate.getMinutes().toString().padStart(2,0)
	const second = nDate.getSeconds().toString().padStart(2,0)
	
	return year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second
})

app.$mount()
